/******************************************************************************
** 
** Fahrenheit to celcius, accurate precision
** 
** File name:	fahr_to_celc_float.c
** Compilation:	cc fahr_to_celc_float.c -o fahr_to_celc_float
** Execution:	./fahr_to_celc_float
** 
** Description:
** Prints a table of Fahrenheit degrees values and the corresponding Celcius
** degrees values.
** 
******************************************************************************/
#include <stdio.h>

main()
{
   float fahr, celcius;
   int lower, upper, step;

   lower = 0;       // lower temperature in the table
   upper = 300;     // upper temperature in the table
   step = 20;

    printf("%10s %10s\n", "Fahrenheit", "Celcius");

   fahr = lower;
   while(fahr <= upper) {
       celcius = (5.0 / 9.0) * (fahr-32.0);
       printf("%10.0f %10.2f\n", fahr, celcius);
       fahr = fahr + step;
   }
}

